package edu.pku.sei.transformation.editor.controller.editparts.node;

import java.beans.PropertyChangeEvent;

import org.eclipse.draw2d.IFigure;

import edu.pku.sei.modeler.model.structure.MetaShapeElement;
import edu.pku.sei.transformation.editor.model.ModelPackage;
import edu.pku.sei.transformation.editor.views.figures.LiteralDomainFigure;

public class LiteralDomainEditpart extends DomainEditpart {

	public LiteralDomainEditpart(MetaShapeElement model) {
		super(model);
	}

	@Override
	protected IFigure createFigure() {
		return new LiteralDomainFigure();
	}

	@Override
	protected void handlePropertyChanged(PropertyChangeEvent event) {
		String propertyName = event.getPropertyName();
		if (ModelPackage.LITERAL_DOMAIN_CONTENT.equals(propertyName)) {
			((LiteralDomainFigure) getFigure()).setContext(event.getNewValue()
					.toString());
		}
		super.handlePropertyChanged(event);
	}

}
